

function updat() {
    var oldPwd=$("#usernameId").val()
    var pwd1=$("#userPwdId1").val()
    var pwd2=$("#userPwdId2").val()


    if(pwd2.length!=0 && pwd1.length!=0 &&pwd1==pwd2 && oldPwd!=null){
        $.post("/user/updatePwd","oldPwd="+oldPwd+"&newPwd="+pwd2,function (info) {
            if(info=="ok"){
                alert("密码修改成功")
                top.location.href="/html/login.html";
            }else {
                alert("密码修改失败")
                location.href="/html/changePwd/changePwd.html";
            }
        })
    }else {
        alert("密码修改失败，两次密码不一致,或者未填写")
        location.href="/html/changePwd/changePwd.html"
    }
}
